/**
 * Created by lt on 2017/5/3.
 */

$(function() {


    $("#advertSubmit").click(function () {
        var orderId = $("#orderId").val();
        var expressOrderId = $("#expressOrderId").val();
        var expressCode = $("#expressCode").val();
        var expressName = $("#expressCode").find("option:selected").text();


        var postData = {
            orderId: orderId,
            expressName: expressName,
            expressCode: expressCode,
            expressOrderId: expressOrderId
        }
        $.ajax({
            type: 'Post',
            url: '/logistics/addExpressInfo.html',
            data: postData,
            success: function (data) {
                var data = $.parseJSON(data);
                if (data.code != 1) {
                    layer.msg(data.msg, {icon: 5, time: 1000});
                    console.log(data.msg);
                    return;
                }
                layer.msg('操作成功!', {icon: 6, time: 1000}, function () {
                    window.parent.location.reload();
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                })
            }
        });


    });
});